function record = subsasgn(record,index,val)
% SUBSASGN Define index assignment for SinkToFile objects
switch index.type
    case '()'
        error('Not supported');
    case '.'
        switch index.subs
            case 'time'
                record.time = val;
            case 'mean'
                record.mean = val;
            case 'var'
                record.var  = val;
            case 'repeat'
                record.repeat = repeat;
            case 'VariableName'
                record.VariableName = val;
            case 'VariableUnit'
                record.VariableUnit = val;
            otherwise
                error('Undefined field');
        end
end